dll-lib=libmydll.so
static-lib=libmystatic.a

.PHONY:all
all:$(dll-lib) $(static-lib)
	
$(static-lib):static.o
	ar -rc $@ $^
static.o:static.c
	gcc -c $^

$(dll-lib):mylog.o myprint.o
	gcc -shared -o $@ $^

mylog.o:mylog.c
	gcc -fPIC -c $^

myprint.o:myprint.c
	gcc -fPIC -c $^

.PHONY:clean
clean:
	rm -rf *.o *.a *.so mylib

.PHONY:output
output:
	mkdir -p mylib/include
	mkdir -p mylib/lib
	cp *.h mylib/include
	cp *.a mylib/lib
	cp *.so mylib/lib
